#! /usr/bin/python3
# _*_ coding:UTF-8 _*_
"""
    类的限制访问
"""


class Student(object):

    def __init__(self, name, num, score):
        self.__name = name
        self.__num = num
        self.__score = score

    def get_name(self,):
        return self.__name

    def set_name(self, name):
        self.__name = name

    def leaning(self):
        print(self.name + ' is leaning!')

    def print_score(self):
        print('%s的num是%d' % (self.name, self.num))
        print('%s的score是%d' % (self.name, self.score))

    def get_grade(self):
        if self.__score >= 90:
            return 'A'
        elif self.__score >= 60:
            return 'B'
        else:
            return 'C'


def main():
    bart = Student('bart', 20, 90)
    print(bart.get_name())
    bart.set_name('wangnan')
    print(bart.get_name())


if __name__ == '__main__':
    main()
